package java9_22.Test2;

import java.io.Serializable;
//对象序列化必须实现Serilizable接口
public class User implements Serializable {
    private  String name;//名字
    private  int  cipher;//密码
  //无参构造
    public User() {

    }
   //有参构造
    public User(String name, int cipher) {
        this.name = name;
        this.cipher = cipher;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCipher() {
        return cipher;
    }

    public void setCipher(int cipher) {
        this.cipher = cipher;
    }

    @Override
    public String toString() {
        return "用户{" +
                "名字='" + name + '\'' +
                ", 密码=" + cipher +
                '}';
    }
}
